import { request } from '@/utils/request'
import type { NewRegulationInfoVo, LawVo, SignVo, DrivingLicenseTypeVo, BaseLoadQueryParams, LearnBaseInfo, LearnBaseQuestionOtherInfo, KnowDescriptionVo } from './types'

export const getDriveListApi = () => {
  return request<DrivingLicenseTypeVo>({
    url: '/api/base/drive_list',
    method: 'GET',
  })
}

/**
 *  题库下载
 * @param params
 * @returns LearnBaseInfo
 */
export const baseLoadApi = (params: BaseLoadQueryParams) => {
  return request<LearnBaseInfo>({
    url: '/api/base/load',
    method: 'GET',
    data: params,
  })
}

/**
 *试题其他信息
 * @param questionId
 * @returns
 */
export const getQuestionOtherInfoApi = (questionId: number) => {
  return request<LearnBaseQuestionOtherInfo>({
    url: `/api/base/qb/other_info/${questionId}`,
    method: 'GET',
  })
}


/**
 * 根据考点ID获取考点描述信息
 * @param knowId
 * @returns
 */
export const getKnowDescApi = (knowId: number) => {
  return request<KnowDescriptionVo>({
    url: `/api/base/know_desc/${knowId}`,
    method: 'GET',
  })
}


/**
 *交通标志
 * @returns
 */
export const getSignsApi = () => {
  return request<SignVo[]>({
    url: `/api/base/signs`,
    method: 'GET',
  })
}

/**
 *法律法规
 * @returns
 */
export const getLawsApi = () => {
  return request<LawVo[]>({
    url: `/api/base/laws`,
    method: 'GET',
  })
}

/**
 * 新规资料
 * @param driveType
 * @param examReason
 * @returns
 */
export const getNewRegulationInfoListApi = (driveType: string, examReason: string) => {
  return request<NewRegulationInfoVo[]>({
    url: `/api/base/new/regulation/infos/${driveType}/${examReason}`,
    method: 'GET',
  })
}
